package com.jgp.workflow.service.impl;

import com.jgp.workflow.pojo.VirtualNode;
import com.jgp.workflow.service.VirtualNodeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

/**
 * 项目   jgp-cloud-parent
 * 作者   loufei
 * 时间   2019/1/6
 */
@Service
public class VirtualNodeServiceImpl implements VirtualNodeService {
    
    @Autowired
    private TaskService taskService;
    
    @Override
    public void addNode(String procId,String taskId,VirtualNode virtualNode) {
        Assert.isTrue(StringUtils.isNotBlank(procId), "流程实例ID不能为空！");
        Assert.isTrue(StringUtils.isNotBlank(taskId), "任务ID不能为空！");
        Task task = taskService.createTaskQuery().processInstanceId(procId).active().taskId(taskId).singleResult();
        
    }
}
